---@diagnostic disable: undefined-global
local prefab_id = 'staff_arachnidnexus'
local mid = '_skin_'

WEBBER_THE_TRAINER_API.MakeItemSkinDefaultImage(prefab_id, "images/inventoryimages/"..prefab_id..".xml", prefab_id)

local suffix = 'devil_trident'
WEBBER_THE_TRAINER_API.MakeItemSkin(prefab_id,prefab_id..mid..suffix,{
    name = STRINGS.MOD_WEBBER_THE_TRAINER.SKIN_API.SKINS[prefab_id][suffix],
    rarity = STRINGS.MOD_WEBBER_THE_TRAINER.SKIN_API.rare.elegent,
    raritycorlor = TUNING.MOD_WEBBER_THE_TRAINER.SKIN_API.rare.elegent,
    atlas = "images/inventoryimages/"..prefab_id..mid..suffix..".xml",
    image = prefab_id..mid..suffix,
    build = prefab_id..mid..suffix,
    bank =  prefab_id..mid..suffix,
    anim = "idle",
    animcircle = true,
    basebuild = prefab_id,
    basebank =  prefab_id,
    baseanim = "idle",
    baseanimcircle = true,
    skinpostfn = function(tbl)
        local old_init = tbl.init_fn
        tbl.init_fn = function(i,...)
            if i.Light then
                i.Light:SetColour(1,1,1)
            end
            return old_init ~= nil and old_init(i,...) or nil
        end
        local old_clear = tbl.clear_fn
        ---comment
        ---@param i ent
        ---@param ... unknown
        tbl.clear_fn = function(i,...)
            if i.Light then
                i.Light:SetColour(unpack({199/255, 119/255, 214/255}))
            end
            return old_clear ~= nil and old_clear(i,...) or nil
        end
    end
})

